<?php
// +---------------------------------------------------------------------------+
// | This file is part of the KnowledgebasePublisher package                   |
// | KnowledgebasePublisher - web based knowledgebase publisher tool           |
// |                                                                           |
// | Author:  Evgeny Leontev <eleontev@gmail.com>                              |
// | Copyright (c) 2005 Evgeny Leontev                                         |
// |                                                                           |
// | For the full copyright and license information, please view the LICENSE   |
// | file that was distributed with this source code.                          |
// +---------------------------------------------------------------------------+

class MemberView_form extends AppView
{
	
	var $tmpl = 'form.html';
	
	
	function execute(&$obj, &$manager) {

		$this->addMsg('user_msg.ini');
		
		$tpl = &new tplTemplatez($this->template_dir . $this->tmpl);
		$tpl->tplAssign('error_msg', AppMsg::errorBox($obj->errors));
		
		
		if($this->controller->getAction() == 'update') {
			$tpl->tplSetNeeded('/not_change_pass');
		}
		
		// roles
		//$select = new FormSelect();
		//$select->setSelectWidth(250);
		//$select->setSelectName('role_id');
		//$select->setRange($manager->getRolesSelectRange(), array(0=>'__'
		//														 //'-1'=>$this->msg['all_roles_msg']
		//														 ));
		
		//$tpl->tplAssign('role_select', $select->select($obj->get('role_id')));
		
		
		$val = ($_POST) ? $_POST['not_change_pass'] : 1;
		$tpl->tplAssign('pass_change_checked', $this->getChecked($val));
		
		
		$tpl->tplAssign($this->setCommonFormVars($obj));
		$tpl->tplAssign($this->setStatusFormVars($obj->get('active')));
		$tpl->tplAssign($obj->get());
		$tpl->tplAssign($this->msg);
		
		$tpl->tplParse();
		return $tpl->tplPrint(1);
	}
}
?>